<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>欢迎登录</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/SCSystem.css">
    <link rel="stylesheet" href="../css/bootstrapValidator.css">
</head>
<body>

<script src="../js/jquery-1.12.4.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/navAjax.js"></script>
<script src="../js/alert.js"></script>
<script src="../js/btnEvent.js"></script>

<div class="container-fluid">
    <!--js引入head-->
    <script src="../js/head.js"></script>
    <!--导航条-->
    <nav class="navbar navbar-default " id="navbar" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <!--响应式设置-->
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#studentNavbar">
                    <span class="sr-only">切换导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">
                    <img alt="Brand" src="/SCSystem/img/brand.png" width="20px" height="20px">
                </a>
            </div>
            <div class="collapse navbar-collapse" id="studentNavbar">
                <ul class="nav  nav-top nav-pills navbar-left">
                    <li class="active"><a href="/SCSystem/html/main.html" role="button">首页</a></li>
                    <li id="addCourseNav"><a role="button">添加课程</a></li>
                    <li id="showCourseNav"><a role="button">查看课程</a></li>
                    <!--下拉菜单-->
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">信息查询<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a>个人课表查询</a></li>
                            <li><a>学习成绩查询</a></li>
                            <li><a>成绩确认</a></li>
                        </ul>
                    </li>
                    <!--下拉菜单-->
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">信息维护<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a role="button">修改个人信息</a></li>
                        </ul>
                    </li>
                    <!--退出按钮-->
                    <li><a role="button">安全退出</a></li>
                </ul>
            </div>
        </div>
    </nav>
</div>

<script>
    window.onload=function () {
        //定义文件根路径
        window.basePath = "/SCSystem/"
        //当点击导航时，添加活动类'.active'
        $("#studentNavbar").find('li').each(function() {
            $(this).click(function() {
                $("#studentNavbar").find('li[class*="active"]').removeClass('active')
                $(this).addClass('active')
            })
        })
        //实现导航栏自动折叠
        $("#studentNavbar li[class!='dropdown']").click(function() {
            $('#studentNavbar').collapse('hide')
        })
        $(window).scroll(function() {
            $('#studentNavbar').collapse('hide')
        })
        //使导航不被导航条遮挡
        $('#studentNavbar').css("overflow","visible")
    }
</script>

</body>
</html>